package apps.sim.core;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ExecutorFactory {

	private static final int COUNT_CORE_THREADS = 5;
	private static final int COUNT_MAX_THREADS = 20;
	private static final int COUNT_POOL_SIZE = 10;
	private static final int KEEP_ALIVE_TIME_SECONDS = 600;

	public static Executor arrayBlockingExecutor() {
		return new ThreadPoolExecutor(COUNT_CORE_THREADS, COUNT_MAX_THREADS, KEEP_ALIVE_TIME_SECONDS, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(COUNT_POOL_SIZE));
	}

}
